#include "ClientFileLoader.h"
#include <fstream>
#include <string>
#include <iostream>
#include "cocos2d.h"
#include "extend/FileDecoder.h"

USING_NS_CC;

ClientFileLoader* ClientFileLoader::instance = NULL;

ClientFileLoader* ClientFileLoader::getInstance()
{
	if (instance == NULL)
	{
		instance = new ClientFileLoader();
	}
	return instance;
}

void ClientFileLoader::destory()
{
	delete instance;
	instance = NULL;
}

std::string ClientFileLoader::load(const std::string& filepath)
{
    std::string str = FileUtils::getInstance()->getStringFromFile(filepath);
    FileDecoder::decode(str);
    return str;
}
